var setting = {
			check: {
				enable: true
			},
			data: {
				simpleData: {
					enable: true
				}
			}
		};

		var zNodes =[
			{ id:1, pId:0, name:"随意勾选 1", open:true},
			{ id:11, pId:1, name:"随意勾选 1-1", open:true},
			{ id:111, pId:11, isParent:1, name:"随意勾选 1-1-1"},
			{ id:112, pId:11, name:"随意勾选 1-1-2"},
			{ id:12, pId:1, name:"随意勾选 1-2", open:true},
			{ id:121, pId:12, name:"随意勾选 1-2-1"},
			{ id:122, pId:12, name:"随意勾选 1-2-2"},
			{ id:2, pId:0, name:"随意勾选 2", open:true},
			{ id:21, pId:2, name:"随意勾选 2-1"},
			{ id:23, pId:2, name:"随意勾选 2-3"},
			{ id:33, pId:3, name:"随意勾选 2-2", open:true},
			{ id:331, pId:32, name:"随意勾选 2-2-1"},
			{ id:332, pId:32, name:"随意勾选 2-2-2"}
		];
		
		var code;
		
		function selectAll() {
			var zTree = $.fn.zTree.getZTreeObj("treeDemo");
			zTree.setting.edit.editNameSelectAll =  $("#selectAll").attr("checked");
		}
		
		function getAllID(){
			var zTree = $.fn.zTree.getZTreeObj("treeDemo");  
		    var changedNodes = zTree.getChangeCheckedNodes();  
		    console.log(zTree.getNodes());
		    for ( var i=0 ; i < changedNodes.length ; i++ ){  
	        var treeNode = changedNodes[i];  
	        	console.log((treeNode?treeNode.name:"root") + "checked " +(treeNode.checked?"true":"false"));  
	        }  
		}
		$("#checkval").click(function(){
			getAllID();
		})
		$(document).ready(function(){
			$.fn.zTree.init($("#treeDemo"), setting, zNodes);
			$("#selectAll").bind("click", selectAll);
		});